package com.sports.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sports.mapper.OrdersMapper;
import com.sports.pojo.Orders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrdersServiceImpl implements IOrdersService {
    @Autowired
    private OrdersMapper mapper;


    @Override
    public List<Orders> list() {
        return mapper.selectList(new QueryWrapper<>());
    }

    @Override
    public Orders getById(Integer id) {
        return mapper.selectById(id);
    }

    @Override
    public Integer add(Orders orders) {
        return mapper.insert(orders);
    }

    @Override
    public Integer update(Orders orders) {
        return mapper.updateById(orders);
    }

    @Override
    public Integer delete(Integer id) {
        return mapper.deleteById(id);
    }

}
